package com.top.entities;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.lang.Nullable;

import java.io.Serializable;
import java.util.Date;

/**
 * @Autor zhangjiawen
 * @Date: 2020/8/4 11:16
 */

@TableName("BLADE_LOG_ERROR")
public class LogError implements Serializable {
        private static final long serialVersionUID = 1L;
        @JsonSerialize(
                using = ToStringSerializer.class
        )
        @TableId(
                value = "id",
                type = IdType.ID_WORKER
        )
        private Long id;
        private String serviceId;
        private String env;
        private String serverIp;
        private String serverHost;
        private String userAgent;
        @Nullable
        private String requestUri;
        private String method;
        private String stackTrace;
        private String exceptionName;
        private String message;
        private String methodClass;
        private String fileName;
        private String methodName;
        private String params;
        private Integer lineNumber;
        private String createBy;
        @DateTimeFormat(
                pattern = "yyyy-MM-dd HH:mm:ss"
        )
        @JsonFormat(
                pattern = "yyyy-MM-dd HH:mm:ss"
        )
        private Date createTime;

        public LogError() {
        }

        public Long getId() {
            return this.id;
        }

        public String getServiceId() {
            return this.serviceId;
        }

        public String getEnv() {
            return this.env;
        }

        public String getServerIp() {
            return this.serverIp;
        }

        public String getServerHost() {
            return this.serverHost;
        }

        public String getUserAgent() {
            return this.userAgent;
        }

        @Nullable
        public String getRequestUri() {
            return this.requestUri;
        }

        public String getMethod() {
            return this.method;
        }

        public String getStackTrace() {
            return this.stackTrace;
        }

        public String getExceptionName() {
            return this.exceptionName;
        }

        public String getMessage() {
            return this.message;
        }

        public String getMethodClass() {
            return this.methodClass;
        }

        public String getFileName() {
            return this.fileName;
        }

        public String getMethodName() {
            return this.methodName;
        }

        public String getParams() {
            return this.params;
        }

        public Integer getLineNumber() {
            return this.lineNumber;
        }

        public String getCreateBy() {
            return this.createBy;
        }

        public Date getCreateTime() {
            return this.createTime;
        }

        public void setId(final Long id) {
            this.id = id;
        }

        public void setServiceId(final String serviceId) {
            this.serviceId = serviceId;
        }

        public void setEnv(final String env) {
            this.env = env;
        }

        public void setServerIp(final String serverIp) {
            this.serverIp = serverIp;
        }

        public void setServerHost(final String serverHost) {
            this.serverHost = serverHost;
        }

        public void setUserAgent(final String userAgent) {
            this.userAgent = userAgent;
        }

        public void setRequestUri(@Nullable final String requestUri) {
            this.requestUri = requestUri;
        }

        public void setMethod(final String method) {
            this.method = method;
        }

        public void setStackTrace(final String stackTrace) {
            this.stackTrace = stackTrace;
        }

        public void setExceptionName(final String exceptionName) {
            this.exceptionName = exceptionName;
        }

        public void setMessage(final String message) {
            this.message = message;
        }

        public void setMethodClass(final String methodClass) {
            this.methodClass = methodClass;
        }

        public void setFileName(final String fileName) {
            this.fileName = fileName;
        }

        public void setMethodName(final String methodName) {
            this.methodName = methodName;
        }

        public void setParams(final String params) {
            this.params = params;
        }

        public void setLineNumber(final Integer lineNumber) {
            this.lineNumber = lineNumber;
        }

        public void setCreateBy(final String createBy) {
            this.createBy = createBy;
        }

        public void setCreateTime(final Date createTime) {
            this.createTime = createTime;
        }

        @Override
        public boolean equals(final Object o) {
            if (o == this) {
                return true;
            } else if (!(o instanceof LogError)) {
                return false;
            } else {
                LogError other = (LogError)o;
                if (!other.canEqual(this)) {
                    return false;
                } else {
                    Object this$id = this.getId();
                    Object other$id = other.getId();
                    if (this$id == null) {
                        if (other$id != null) {
                            return false;
                        }
                    } else if (!this$id.equals(other$id)) {
                        return false;
                    }

                    Object this$serviceId = this.getServiceId();
                    Object other$serviceId = other.getServiceId();
                    if (this$serviceId == null) {
                        if (other$serviceId != null) {
                            return false;
                        }
                    } else if (!this$serviceId.equals(other$serviceId)) {
                        return false;
                    }

                    Object this$env = this.getEnv();
                    Object other$env = other.getEnv();
                    if (this$env == null) {
                        if (other$env != null) {
                            return false;
                        }
                    } else if (!this$env.equals(other$env)) {
                        return false;
                    }

                    label206: {
                        Object this$serverIp = this.getServerIp();
                        Object other$serverIp = other.getServerIp();
                        if (this$serverIp == null) {
                            if (other$serverIp == null) {
                                break label206;
                            }
                        } else if (this$serverIp.equals(other$serverIp)) {
                            break label206;
                        }

                        return false;
                    }

                    label199: {
                        Object this$serverHost = this.getServerHost();
                        Object other$serverHost = other.getServerHost();
                        if (this$serverHost == null) {
                            if (other$serverHost == null) {
                                break label199;
                            }
                        } else if (this$serverHost.equals(other$serverHost)) {
                            break label199;
                        }

                        return false;
                    }

                    Object this$userAgent = this.getUserAgent();
                    Object other$userAgent = other.getUserAgent();
                    if (this$userAgent == null) {
                        if (other$userAgent != null) {
                            return false;
                        }
                    } else if (!this$userAgent.equals(other$userAgent)) {
                        return false;
                    }

                    label185: {
                        Object this$requestUri = this.getRequestUri();
                        Object other$requestUri = other.getRequestUri();
                        if (this$requestUri == null) {
                            if (other$requestUri == null) {
                                break label185;
                            }
                        } else if (this$requestUri.equals(other$requestUri)) {
                            break label185;
                        }

                        return false;
                    }

                    label178: {
                        Object this$method = this.getMethod();
                        Object other$method = other.getMethod();
                        if (this$method == null) {
                            if (other$method == null) {
                                break label178;
                            }
                        } else if (this$method.equals(other$method)) {
                            break label178;
                        }

                        return false;
                    }

                    Object this$stackTrace = this.getStackTrace();
                    Object other$stackTrace = other.getStackTrace();
                    if (this$stackTrace == null) {
                        if (other$stackTrace != null) {
                            return false;
                        }
                    } else if (!this$stackTrace.equals(other$stackTrace)) {
                        return false;
                    }

                    Object this$exceptionName = this.getExceptionName();
                    Object other$exceptionName = other.getExceptionName();
                    if (this$exceptionName == null) {
                        if (other$exceptionName != null) {
                            return false;
                        }
                    } else if (!this$exceptionName.equals(other$exceptionName)) {
                        return false;
                    }

                    label157: {
                        Object this$message = this.getMessage();
                        Object other$message = other.getMessage();
                        if (this$message == null) {
                            if (other$message == null) {
                                break label157;
                            }
                        } else if (this$message.equals(other$message)) {
                            break label157;
                        }

                        return false;
                    }

                    label150: {
                        Object this$methodClass = this.getMethodClass();
                        Object other$methodClass = other.getMethodClass();
                        if (this$methodClass == null) {
                            if (other$methodClass == null) {
                                break label150;
                            }
                        } else if (this$methodClass.equals(other$methodClass)) {
                            break label150;
                        }

                        return false;
                    }

                    Object this$fileName = this.getFileName();
                    Object other$fileName = other.getFileName();
                    if (this$fileName == null) {
                        if (other$fileName != null) {
                            return false;
                        }
                    } else if (!this$fileName.equals(other$fileName)) {
                        return false;
                    }

                    label136: {
                        Object this$methodName = this.getMethodName();
                        Object other$methodName = other.getMethodName();
                        if (this$methodName == null) {
                            if (other$methodName == null) {
                                break label136;
                            }
                        } else if (this$methodName.equals(other$methodName)) {
                            break label136;
                        }

                        return false;
                    }

                    Object this$params = this.getParams();
                    Object other$params = other.getParams();
                    if (this$params == null) {
                        if (other$params != null) {
                            return false;
                        }
                    } else if (!this$params.equals(other$params)) {
                        return false;
                    }

                    label122: {
                        Object this$lineNumber = this.getLineNumber();
                        Object other$lineNumber = other.getLineNumber();
                        if (this$lineNumber == null) {
                            if (other$lineNumber == null) {
                                break label122;
                            }
                        } else if (this$lineNumber.equals(other$lineNumber)) {
                            break label122;
                        }

                        return false;
                    }

                    Object this$createBy = this.getCreateBy();
                    Object other$createBy = other.getCreateBy();
                    if (this$createBy == null) {
                        if (other$createBy != null) {
                            return false;
                        }
                    } else if (!this$createBy.equals(other$createBy)) {
                        return false;
                    }

                    Object this$createTime = this.getCreateTime();
                    Object other$createTime = other.getCreateTime();
                    if (this$createTime == null) {
                        if (other$createTime != null) {
                            return false;
                        }
                    } else if (!this$createTime.equals(other$createTime)) {
                        return false;
                    }

                    return true;
                }
            }
        }

        protected boolean canEqual(final Object other) {
            return other instanceof LogError;
        }


        @Override
        public String toString() {
            return "LogError(id=" + this.getId() + ", serviceId=" + this.getServiceId() + ", env=" + this.getEnv() + ", serverIp=" + this.getServerIp() + ", serverHost=" + this.getServerHost() + ", userAgent=" + this.getUserAgent() + ", requestUri=" + this.getRequestUri() + ", method=" + this.getMethod() + ", stackTrace=" + this.getStackTrace() + ", exceptionName=" + this.getExceptionName() + ", message=" + this.getMessage() + ", methodClass=" + this.getMethodClass() + ", fileName=" + this.getFileName() + ", methodName=" + this.getMethodName() + ", params=" + this.getParams() + ", lineNumber=" + this.getLineNumber() + ", createBy=" + this.getCreateBy() + ", createTime=" + this.getCreateTime() + ")";
        }
    }

